package com.dmz.kubernetes.controller;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.dmz.kubernetes.config.DummyConfig;
import com.dmz.kubernetes.feign.Service2Client;

@RestController
@RequestMapping("/kubernetes/")
public class KubernetesController {


	@Autowired
    private DummyConfig dummyConfig;
	@Autowired
	private Service2Client service2Client;
	
    @RequestMapping("/getRemoteMessage")
    public String getRemoteMessage() {
    	return service2Client.invokeService2();
    }

    @RequestMapping("/getConfig")
    public String getKubernetesConfigs() {
    	return dummyConfig.getMessage()
                + " ["
                + new SimpleDateFormat().format(new Date())
                + "]";
    }
}
